import json

class MyShape:
    def __init__(self, *args, Pi=3.14):
        self.args = args
        self.Pi = Pi

    def area(self):
        raise NotImplementedError

class Traigle(MyShape):
    def area(self):
        l, h = self.args
        return '{:.2f}'.format(l * h / 2)

class Rectangle(MyShape):
    def area(self):
        l, h = self.args
        return '{:.2f}'.format(l * h)

class Circle(MyShape):
    def area(self):
        r = self.args
        return '{:.2f}'.format(pow(*r,2) * self.Pi)

class MyPrint:
    @classmethod
    def myprint(cls, classname, area):
        print("{}'s area is {}".format(classname, area))

class SeiralizeMixin:
    def seiralize(self):
        print(json.dumps(self.__dir__()))

class CircleMixin(SeiralizeMixin, Circle): pass

t = Traigle(3, 4)
MyPrint().myprint(type(t).__name__, t.area())

r = Rectangle(3, 4)
MyPrint().myprint(type(r).__name__, r.area())

c = Circle(5)
MyPrint().myprint(type(c).__name__, c.area())

sc = CircleMixin(5)
sc.seiralize()

# MyShape基类的init方法为什么要传Pi进去，再说变量名一般都是小写的，这个变量格式有问题
# 每个不同的类有不同的参数个数，为什么不重写init方法呢
